﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

/// <summary>
/// A resource used by one or more elements
/// </summary>
public class RBResource {
    private int id;
    private string comment;
    private Dictionary<string, RBTranslation> translations;

    /// <summary>
    /// Gets or sets resource ID.
    /// </summary>
    /// <value>The ID.</value>
    public int ID {
        get { return id; }
        set { id = value; }
    }

    /// <summary>
    /// Gets or sets the comment for this resource.
    /// </summary>
    /// <value>The comment.</value>
    public string Comment {
        get { return comment; }
        set { comment = value; }
    }

    /// <summary>
    /// Gets or sets a dictionary of translations for the resource sorted by the language's English name. In the format <code, translation>
    /// </summary>
    /// <value>A dictionary of the translations available.</value>
    public Dictionary<string, RBTranslation> Translations {
        get { return translations; }
        set { translations = value; }
    }

    /// <summary>
    /// Initializes a new <see cref="RBResource"/>.
    /// </summary>
    public RBResource() {
        id = -1;
        comment = string.Empty;
        translations = new Dictionary<string, RBTranslation>();
    }

    /// <summary>
    /// Initializes a new <see cref="RBResource"/>.
    /// </summary>
    /// <param name="id">The id.</param>
    /// <param name="comment">The comment.</param>
    public RBResource(int id, string comment)
        : this() {
        this.id = id;
        this.comment = comment;
    }
}